package com.core.family.admin.domain;

import lombok.AllArgsConstructor;
import lombok.Getter;

/***
 * @ClassName OpenCodePltEn
 * @Description :
 * @Author hl
 * @Date 2024/5/8 15:27
 * @Version 1.0
 */
@AllArgsConstructor
@Getter
public enum CodePltEnum {
    //平台类型0自研,1github,2gitee
    OWER(0, "ower"),
    GITHUB(1, "github"),
    GITEE(2, "gitee"),
    GITLAB(3, "gitlab"),
    ;

    public static int selectCode(String sourePath) {
        for (CodePltEnum codePltEnum : CodePltEnum.values()) {
            if (sourePath.contains(codePltEnum.name)) {
                return codePltEnum.code;
            }
        }
        return 0;
    }

    private int code;
    private String name;
}
